<?php
/**
 * This script contains the upload keywords file
 * Keywords file must be in csv format
 * Filename of the keywords file is the category and the first column contains the keywords to be used in generating the static files
 */ 

require_once 'includes/File.php';

$bFileUpload = false;
if (isset($_POST['fileUpload'])) {
	if ('1' == $_POST['fileUpload']) {
		$bFileUpload = true;
	}
}

if ($bFileUpload) { //file upload button is clicked
	$objFile = new File($_FILES, 'keywordsFile');
	$bUploadSuccessful = $objFile->uploadFile();
	
	if ($bUploadSuccessful) {
		$objFile->readCsvFile();		
	}
}
?>
<html>
<head>
	<title>UPLOAD KEYWORDS</title>
</head>
<body>
<form enctype="multipart/form-data" action="" method="POST">
Choose a file to upload: <input name="keywordsFile" type="file" /><br />
<input type="hidden" name="fileUpload" value="1"/>
<input type="submit" value="Submit" />
</form>
</body>
</html>
